package com.spboot.util;

import lombok.Data;

/**
 * ajax请求返回结果实体类
 */
@Data
public class Result {

    private Object data;
    private String msg = "操作成功";
    private int code = 200;
    private boolean status = true;

    public static Result ok(Object data) {
        Result result = new Result();
        result.setData(data);
        return result;
    }

    public static Result error(String msg) {
        Result result = new Result();
        result.setCode(500);
        result.setStatus(false);
        return result;
    }
}
